<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.nobody.facepk.pojo.SessionUser"%>
<%@page import="com.nobody.facepk.model.Picture"%>
<%@page import="com.nobody.facepk.model.Friends"%>
<%@page import="com.nobody.facepk.model.Comment"%>
<%@page import="com.nobody.facepk.sns.Event"%>
<%@page import="com.nobody.facepk.sns.EventType"%>
<%@page import="com.nobody.facepk.model.User"%>
<%@page import="com.nobody.facepk.view.MatchView"%>
<%@page import="com.nobody.facepk.service.PictureService"%>
<%@page import="com.nobody.facepk.service.ServiceRegistry"%>
<%@page import="com.nobody.facepk.service.UserService"%>
<%@page import="com.nobody.facepk.service.CommentService"%>
<%@page import="java.util.Set"%>
<%@page import="java.util.List;"%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="sheet1.css" media="all"></link>
  <%
  SessionUser user = (SessionUser)request.getSession().getAttribute("SESSION_USER");
  List  pictures = (List)request.getAttribute("myPictures");
  int picturesSize = pictures.size();
  List  friendPictures = (List)request.getAttribute("friendPictures");
  int friendPictureSize  = friendPictures.size();
  %>
</head>
<body>


  <table>
    	我目前所有的的照片:<br/>
    	<%
    	if(picturesSize == 0 ){%>
    	暂无图片。
    	<%}else{
    	if(picturesSize>4) picturesSize = 4; //首页最多显示6张
    	for(int i = 0 ; i < picturesSize ; i ++){
    	Picture  pic  = (Picture)pictures.get(i);
    	String picPath = pic.getPath();
    	String picName = pic.getName();
    	String realPath = "pictures/"+pic.getUserId()+"/"+picPath;
    	%>
    	<img src="<%=realPath%>" height="80" width="80"/>
    	<a href="gradeInfo.jsp?pictureId=<%=pic.getId()%>">上传</a>
    	<%
           }
    	 }
    	%>
   		
   	</table>
   			 
   <table>
    	我的好友的所有的的照片:<br/>
    	<%
    	if(friendPictureSize == 0 ){%>
    	暂无图片。
    	<%}else{
    	if(friendPictureSize>4) friendPictureSize = 4; //首页最多显示6张
    	for(int i = 0 ; i < friendPictureSize ; i ++){
    	Picture  pic  = (Picture)friendPictures.get(i);
    	String picPath = pic.getPath();
    	String picName = pic.getName();
    	String realPath = "pictures/"+pic.getUserId()+"/"+picPath;
    	%>
    	<img src="<%=realPath%>" height="80" width="80"/>
    	<a href="gradeInfo.jsp?pictureId=<%=pic.getId()%>">上传</a>
    	<%
           }
    	 }
    	%>
   		
   	</table>

</body>
</html>